package com.dlut.txy.designpattern.listener;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PublishResult implements Serializable {
    private String result;
    public static final String SUCCESS = "success";
    public static final String FAIL = "fail";

    public static PublishResult buildSuccess() {
        return new PublishResult(SUCCESS);
    }

    public static PublishResult buildFail() {
        return new PublishResult(FAIL);
    }
}
